package com.lewis.jpa.entity;

import java.util.List;

import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

@Entity
@Cacheable(true)
@GenericGenerator(name = "UUID_GEN", strategy = "uuid", parameters = { @Parameter(name = "separator", value = "-") })
public class Course extends BaseEntity<String> {
	
	@Id
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "UUID_GEN")
	@Column(name = "course_id")
	private String id;
	
	@Column(name = "coursename")
	private String courseName;
	
	@ManyToMany(mappedBy = "takingCourse")
	private List<Person> takers;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCourseName() {
		return courseName;
	}

	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}

	public List<Person> getTakers() {
		return takers;
	}

	public void setTakers(List<Person> takers) {
		this.takers = takers;
	}
	
	

}
